package com.ninth_group.vo;


import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * 省会天气信息VO
 */
public class PCWeatherInfoVO {
    private String Province;
    private String weather; // 天气, 晴/阴...
    private int temp;
    private int weatherCode;

    // 结果映射
    public PCWeatherInfoVO mapRow(ResultSet rs) throws SQLException {
        PCWeatherInfoVO pcWeatherInfo = new PCWeatherInfoVO();
        pcWeatherInfo.setProvince(rs.getString("province"));
        pcWeatherInfo.setWeather(rs.getString("weather"));
        pcWeatherInfo.setTemp(Integer.parseInt(rs.getString("temp")));
        return pcWeatherInfo;
    }

    public PCWeatherInfoVO() {
    }

    public PCWeatherInfoVO(String province, String weather, int temp, int weatherCode) {
        Province = province;
        this.weather = weather;
        this.temp = temp;
        this.weatherCode = weatherCode;
    }

    @Override
    public String toString() {
        return "PCWeatherInfoVO{" +
                ", Province='" + Province + '\'' +
                ", weather='" + weather + '\'' +
                ", temp=" + temp +
                ", weatherCode=" + weatherCode +
                '}';
    }


    public String getProvince() {
        return Province;
    }

    public void setProvince(String province) {
        Province = province;
    }

    public String getWeather() {
        return weather;
    }

    public void setWeather(String weather) {
        this.weather = weather;
    }

    public int getTemp() {
        return temp;
    }

    public void setTemp(int temp) {
        this.temp = temp;
    }

    public int getWeatherCode() {
        return weatherCode;
    }

    public void setWeatherCode(int weatherCode) {
        this.weatherCode = weatherCode;
    }
}
